﻿using System;
using System.Collections.Generic;
using System.Text;
using ScriptsGenerator.Helper;

namespace ScriptsGenerator.Manager
{
    /// <summary>
    /// 文件變更履歷
    /// </summary>
    public class Amendment
    {
        public DbVersion Version { get; set; }

        /// <summary>
        /// 變更說明
        /// </summary>
        public string Description { get; set; }
        public string Table { get; set; }
        public string Action { get; set; }
        public string Field { get; set; }
        public int PKeySequence { get; set; }

        public ChangeAction ChangeAction
        {
            get
            {
                switch (Action)
                { 
                    case "A":
                        return ChangeAction.Add;
                    case "C":
                        return ChangeAction.Change;
                    case "D":
                        return ChangeAction.Delete;
                    default:
                        return ChangeAction.None;
                }
            }
        }

        /// <summary>
        /// 修訂人員
        /// </summary>
        public string ModifiedUserID { get; set; }
    }
}
